package a_12_28introspector;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class Test {

     private  static Properties properties = new Properties();

    //静态代码块
    static{
        InputStream inputStream = Thread
                .currentThread()
                .getContextClassLoader()
                .getResourceAsStream("a_12_28introspector\\config.properties");

        try {
            properties.load(inputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

    public static void main(String[] args) {
        String userName = properties.getProperty("userName");
        System.out.println(userName);
    }

}
